-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table Scan Delete File Handling: Positional and Equality Delete Support #652
base: main
Are you sure you want to change the base?
Conversation
0a64237
to
28021a4
Compare
@Xuanwo, @liurenjie1024: This is now ready to review, PTAL when you guys get chance. Look forward to your feedback 😁 |
2732a49
to
50f8a9e
Compare
cf8748a
to
7a8d297
Compare
Hi @liurenjie1024 and @Xuanwo - would either of you be able to review this at some point please? I know it's a bit large, sorry. Thanks :-) |
Hi, @sdd Thanks for your patience. In fact I already started reviewing it, and it's a little large, so it may take some time. |
cc5dba4
to
df4e86a
Compare
Hey @liurenjie1024 - sorry to make changes whilst you are reviewing. I updated the design of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sdd for your patience, it's a really large pr and took me some time to review. I think generally you've understood how deletion files works, but I have some concerns about current code as it mixed a lot of things together. Deletion hanndling is quite chanllenging, I think the design from java implemention is quite reasonable:
I think maybe we need to have a design to split them into more small parts, what do you think?
|
||
/// A task to scan part of file. | ||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq)] | ||
pub struct FileScanTaskDeleteFile { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may evolve as we add more feature, so I would suggest to make this a crate only data structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure? It is present inside FileScanTask
, all of whose items are pub
and is intended for potential consumption outside of the crate.
crates/iceberg/src/scan.rs
Outdated
// that are not applicable to the DataFile? | ||
|
||
DeleteFileManagerFuture { | ||
files: self.files.clone(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect even if we ignore pruning techniques to remove unrelated deletion files. Please see this part for details.
Thanks so much for the review on this @liurenjie1024 - I've been ill for the past week or two so I've not had chance to work through your review in detail yet. I just wanted to let you know I've seen it and will pick it up when I've recovered. 👍 |
Hi, @sdd Sorry to hear that, take care of yourself! Don't worry about this, I'll be happy to discuss about this with you anytime when you're back. |
2ff526f
to
091a249
Compare
@sdd Thanks for doing all this work, could you split out the positional deletes? I think that's already a sizeable chunk. |
Sure @Fokko - I'm in the middle of a refactor of what I have so far. It aligns the design a bit more closely to the Java DeleteFileIndex while still keeping the more efficient loading process from my original. I was thinking of splitting this PR into three - one that is mostly collating all the delete files into the index, and then two more that each focus on the filtering and application of the two delete types. |
@sdd Thank you for your understanding, looking forward to the smaller PRs 👍 From PyIceberg I've learned that there are a lot of subtle optimizations and want to make sure that we handle those correctly 👍 |
9e9ee48
to
a7493f0
Compare
FAO @liurenjie1024, @Xuanwo, @Fokko: I've finished refactoring this and after a few rounds I'm happier with the design of the I will follow up once this is merged with another PR similar to @Xuanwo's recent one as I think we can use similar techniques in the scan plan. I've got a few TODOs in here that mark behaviour that I was unsure of and could do with feedback upon, as well as to indicate missing parts that will be addressed in follow-up PRs. |
Used to encapsulate enough information for DeleteFileIndex to be able to perform the requrired filtering of delete files
…ntime::spawn. Add missing license
…deletes for data file.
…t in a file scan task
d3e4d0d
to
22ef190
Compare
This PR adds support for handling of both positional and equality delete files within table scans.
The approach taken is to include a list of delete file paths in every
FileScanTask
. At the moment it is assumed that this list refers to delete files that may apply to the data file in the scan, rather than having been filtered to only contain delete files that definitely do apply to this data file. Further optimisation ofplan_files
is expected in the future to ensure that this list is pre-filtered before being included in the FileScanTask.This PR has been refactored so that this work can be split into multiple PRs.
This PR now contains solely the scan plan changes.